package com.xxg.renrenproduct.dao;

import com.xxg.renrencommon.domain.dao.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * RenrenShopGoodsSpecDao继承基类
 */
@Mapper
@Repository
public interface RenrenShopGoodsSpecDao extends BaseMapper<RenrenShopGoodsSpec, Integer> {
    @Select("SELECT id, shop_id as shopId, sub_shop_id as subShopId, goods_id as goodsId, display_order as displayOrder, title, image_checked as imageChecked FROM renren_shop_goods_spec\n" +
            "    where goods_id = #{goodsId,jdbcType=INTEGER}")
    List<RenrenShopGoodsSpec> selectByGoodsId(Integer goodsId);

    @Delete("DELETE FROM renren_shop_goods_spec WHERE goods_id = #{goodsId,jdbcType=INTEGER}")
    void deleteByGoodsId(Integer goodsId);
}